package com.yifeng.repo.flink.data.transport.dto;

import com.google.common.base.Strings;

/**
 * 数据库类型的枚举
 * @author lijing
 * @since 2023-01-03
 *
 */
public enum DbTypeEnums {
  
	 MYSQL("mysql", "mysql数据库"), 
	 ORACLE("oracle", "oracle数据库");
	    private final String type;
	    private final String name;

	    public String getType() {
	        return type;
	    }

	    public static DbTypeEnums parse(String type) {
	        if (Strings.isNullOrEmpty(type)) {
	            return null;
	        }
	        DbTypeEnums[] coll = values();
	        for (DbTypeEnums item : coll) {
	            if (item.getType().equals(type)) {
	                return item;
	            }
	        }
	        return null;
	    }

	    public String getName() {
	        return name;
	    }

	    DbTypeEnums(String type, String name) {
	        this.type = type;
	        this.name = name;
	    }
}
